package com.atguigu.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.mapper.CrmBannerMapper;
import com.atguigu.educms.entity.CrmBanner;
import com.atguigu.service.impl.CrmBannerService;

import java.util.List;

/**
 * @author cyt
 * @create 2020-05-14 11:24
 */
@Service
public class CrmBannerServiceImpl extends ServiceImpl<CrmBannerMapper, CrmBanner> implements CrmBannerService {
    /**
     * 存入 redis 缓存中
     * @return
     */
    @Cacheable(value = "banner", key = "'getBanner'")
    /**
     * 查询首页轮播图
     */
    @Override
    public List<CrmBanner> getBanner() {
        return baseMapper.selectList(null);
    }
}
